﻿<ribbon:RibbonTabItem x:Class="Hisaab.Client.Modules.Core.Transaction.View.TransactionsTab"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:ribbon="clr-namespace:Fluent;assembly=Fluent" xmlns:Converters="clr-namespace:Hisaab.Client.Modules.Core.Converters" xmlns:Helpers="clr-namespace:Hisaab.Client.Common.Helpers;assembly=Hisaab.Client.Common" xmlns:Converters1="clr-namespace:Hisaab.Client.Common.Converters;assembly=Hisaab.Client.Common" xmlns:Transaction="clr-namespace:Hisaab.Client.Modules.Core.Transaction" xmlns:Model="clr-namespace:Hisaab.Client.Model;assembly=Hisaab.Client.Model" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:View="clr-namespace:Hisaab.Client.Modules.Core.Transaction.View" Group="{Binding ElementName=cmTransaction, Mode=OneWay}"
            Header="Transactions" >
    <ribbon:RibbonTabItem.Resources>
        <Converters:AccountTypeImageConverter x:Key="accountImageConverter" UseLargeIcon="True"/>
    </ribbon:RibbonTabItem.Resources>
    <ribbon:RibbonGroupBox Header="Actions">
        <View:TransactionAddButton />
        <ribbon:Button Header="Edit" LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/TransactionEdit.png" Command="{x:Static Transaction:TransactionGlobalCommands.EditTransaction}" />
        <ribbon:Button Header="Delete" LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/TransactionDelete.png" Command="{x:Static Transaction:TransactionGlobalCommands.DeleteTransaction}" />
        <ribbon:Button Header="Refresh" LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/TransactionRefresh.png" Command="{x:Static Transaction:TransactionGlobalCommands.RefreshTransaction}" />
    </ribbon:RibbonGroupBox>
    <ribbon:RibbonGroupBox Header="Query">
        <ribbon:InRibbonGallery Icon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Calender.png"
                                LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Calender.png"
                                x:Name="monthSelectGallery" Header="In-Ribbon Gallery" ribbon:KeyTip.Keys="MN"
                                ResizeMode="Both" MinItemsInRow="2" MaxItemsInRow="5" SizeDefinition="Large" Orientation="Horizontal"
                                ItemWidth="40" ItemHeight="56" CanCollapseToButton="True" MinItemsInDropDownRow="4"
                                SelectedValue="{Binding ContextViewModel.MonthFilter}" SelectedValuePath="Tag">
            <ribbon:InRibbonGallery.Items>
                <ribbon:GalleryItem Tag="0">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/CurrentMonth.png" Width="32" Height="32" ribbon:KeyTip.Keys="1" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="1">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthOne.png" Width="32" Height="32" ribbon:KeyTip.Keys="1" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="2">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthTwo.png" Width="32" Height="32" ribbon:KeyTip.Keys="2" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="3">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthThree.png" Width="32" Height="32" ribbon:KeyTip.Keys="3" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="4">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthFour.png" Width="32" Height="32" ribbon:KeyTip.Keys="4" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="5">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthFive.png" Width="32" Height="32" ribbon:KeyTip.Keys="5" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="6">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/MonthSix.png" Width="32" Height="32" ribbon:KeyTip.Keys="6" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem Tag="12">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Year.png" Width="32" Height="32" ribbon:KeyTip.Keys="T" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
                <ribbon:GalleryItem CommandParameter="-1" Tag="-1">
                    <ribbon:GalleryItem.Content>
                        <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Calender.png" Width="32" Height="32" ribbon:KeyTip.Keys="A" />
                    </ribbon:GalleryItem.Content>
                </ribbon:GalleryItem>
            </ribbon:InRibbonGallery.Items>
        </ribbon:InRibbonGallery>
        <ribbon:InRibbonGallery x:Name="accountSelectGallery" Header="In-Ribbon Gallery" ribbon:KeyTip.Keys="MN"
                                ResizeMode="Vertical" MinItemsInRow="2" MaxItemsInRow="3" SizeDefinition="Large" Orientation="Vertical" ItemsSource="{Binding Accounts}"
                                ItemHeight="30" CanCollapseToButton="True" MinItemsInDropDownRow="4" IsEnabled="{Binding ContextViewModel.AllowChangeAccount}"
                                SelectedValue="{Binding ContextViewModel.SelectedQueryAccount}" SelectedValuePath="AccountId">
            <ribbon:InRibbonGallery.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" >
                        <Image Source="{Binding AccountType, Converter={StaticResource accountImageConverter}}" Margin="3 3 10 3"/>
                        <TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
                    </StackPanel>
                </DataTemplate>
            </ribbon:InRibbonGallery.ItemTemplate>
        </ribbon:InRibbonGallery>
    </ribbon:RibbonGroupBox>
    <ribbon:RibbonGroupBox Header="Sorting and filter">
        <ribbon:ToggleButton LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/TransactionRed.png" Header="Expanse" IsChecked="{Binding ContextViewModel.ShowExpanse}" />
        <ribbon:ToggleButton LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Transaction.png" Header="Income" IsChecked="{Binding ContextViewModel.ShowIncome}" />

        <ribbon:DropDownButton Header="Sort By" LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Filter.png" Size="Large" IsEnabled="True" VerticalAlignment="Top">
            <ribbon:Gallery MinItemsInRow="1" MaxItemsInRow="3" Orientation="Vertical" ItemWidth="150" ItemHeight="30" SelectedValue="{Binding ContextViewModel.SortBy}" SelectedValuePath="Tag">

                <Border BorderThickness="4" BorderBrush="Transparent" Tag="{x:Static Model:SortByType.Date}">
                    <StackPanel Orientation="Horizontal">
                        <Image VerticalAlignment="Center" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/Calendar.png" Stretch="None" Margin="0 0 10 0" />
                        <TextBlock Text="Date" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </StackPanel>
                </Border>
                <Border BorderThickness="4" BorderBrush="Transparent" Tag="{x:Static Model:SortByType.Amount}">
                    <StackPanel Orientation="Horizontal">
                        <Image VerticalAlignment="Center" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/TransactionGreen.png" Stretch="None" Margin="0 0 10 0" />
                        <TextBlock Text="Amount" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </StackPanel>
                </Border>
                <Border BorderThickness="4" BorderBrush="Transparent" Tag="{x:Static Model:SortByType.Type}">
                    <StackPanel Orientation="Horizontal">
                        <Image VerticalAlignment="Center" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/Type.png" Stretch="None" Margin="0 0 10 0" />
                        <TextBlock Text="Type" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </StackPanel>
                </Border>
            </ribbon:Gallery>
        </ribbon:DropDownButton>

        <ribbon:DropDownButton Header="Order" LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Sort.png" Size="Large" IsEnabled="True" VerticalAlignment="Top">
            <ribbon:Gallery MinItemsInRow="1" MaxItemsInRow="3" Orientation="Vertical" ItemWidth="150" ItemHeight="30" SelectedValue="{Binding ContextViewModel.SortOrder}" SelectedValuePath="Tag">

                <Border BorderThickness="4" BorderBrush="Transparent" Tag="{x:Static Model:OrderByType.Ascending}">
                    <StackPanel Orientation="Horizontal">
                        <Image VerticalAlignment="Center" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/SortAscending.png" Stretch="None" Margin="0 0 10 0" />
                        <TextBlock Text="Ascending" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </StackPanel>
                </Border>
                <Border BorderThickness="4" BorderBrush="Transparent" Tag="{x:Static Model:OrderByType.Descending}">
                    <StackPanel Orientation="Horizontal">
                        <Image VerticalAlignment="Center" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/SortDescending.png" Stretch="None" Margin="0 0 10 0" />
                        <TextBlock Text="Descending" VerticalAlignment="Center" HorizontalAlignment="Left" />
                    </StackPanel>
                </Border>
            </ribbon:Gallery>
        </ribbon:DropDownButton>
    </ribbon:RibbonGroupBox>
</ribbon:RibbonTabItem >